


	function initialize() {

		geocoder = new google.maps.Geocoder();

		myOptions = {
			center : new google.maps.LatLng(0, 0),
			zoom : 2,
			mapTypeId : google.maps.MapTypeId.ROADMAP
		};
		
		var bounds = new google.maps.LatLngBounds();

		map = new google.maps.Map(document.getElementById("map_canvas"),
				myOptions);

		var addresses = document.getElementById("flights");
		var childs = addresses.getElementsByTagName('div');

		for ( var i = 0; i < childs.length; i++) {

			var address = childs[i].innerHTML;

			geocoder
					.geocode(
							{
								'address' : address
							},
							function(results, status) {
								if (status == google.maps.GeocoderStatus.OK) {
									var marker = new google.maps.Marker({
										map : map,
										position : results[0].geometry.location,
										title : results[0].address_components[1].short_name

									});
									
									 bounds.extend(results[0].geometry.location);
									 map.fitBounds(bounds);

								}

							});

		}

	}
	
	function validate(evt) {
		  var theEvent = evt || window.event;
		  var key = theEvent.keyCode || theEvent.which;
		  key = String.fromCharCode( key );
		  var regex = /[0-9]|\./;
		  if( !regex.test(key) ) {
		    theEvent.returnValue = false;
		    if(theEvent.preventDefault) theEvent.preventDefault();
		  }
		}
	
	function showAirport(address){
		map.setZoom(5);
		
		geocoder
		.geocode(
				{
					'address' : address
				},
				function(results, status) {
					if (status == google.maps.GeocoderStatus.OK) {
						
						map.setCenter(results[0].geometry.location);
						
					}

				});

		
	}

	
	function conversionCurrency(){
		var request=new XMLHttpRequest();
		request.onreadystatechange=function(){
			if(request.readyState==4){
				if(!(request.status==200)){
					alert("internal server error");
				}else{
					document.getElementById("resultText").innerHTML=request.responseText;
				}
			}
		};
		request.open("GET","AjaxHandler?from="+document.getElementById("from").value+
				"&to="+document.getElementById("to").value+
				"&amount="+document.getElementById("amount").value,true);
		request.send();
	}